//
//  main.swift
//  GirlFriend
//
//  Created by Bailinhan on 2017/9/18.
//  Copyright © 2017年 Bailinhan. All rights reserved.
//

import Foundation

class GirlFirend: NSObject {
    var name:String = ""
    var age :Int = 0
    
    //初始化随机姓名和年龄
    override init() {
        name = String(format: "%c%c%c",  40+arc4random(),  40+arc4random(),  40+arc4random())
            age = Int( arc4random() % 10 + 18 )
    }
    
    //重写描述方法
    override var description: String{
        return "姓名:\(name) \t,年龄:\(age)"
    }
    
    //约会方法
    func dataWith() {
        print("约会: name is\(name),age is \(age)")
        
}
}
for i in 0...99{
    var gF = GirlFirend()
    gF.dataWith()
}
